package com.dldata.display.businessmodel;

import com.alibaba.fastjson.JSON;


/**
 * Created by 倪继文 on 2017-12-21.
 */
public class SessionUserInfoEntity {
    public static final com.dldata.display.utils.DesUtil DES_UTIL = com.dldata.display.utils.DesUtil.getDesUtil("devtool@dldata.com", "123456");
    private String uid;
    private String uname;
    private String lname;
    private String zid;
    private String kid;
    private String kname;
    private String sysCode;

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getLname() {
        return lname;
    }

    public void setLname(String lname) {
        this.lname = lname;
    }

    public String getKid() {
        return kid;
    }

    public void setKid(String kid) {
        this.kid = kid;
    }

    public String getKname() {
        return kname;
    }

    public void setKname(String kname) {
        this.kname = kname;
    }

    public String getSysCode() {
        return sysCode;
    }

    public void setSysCode(String sysCode) {
        this.sysCode = sysCode;
    }

    public String getZid() {
        return zid;
    }

    public void setZid(String zid) {
        this.zid = zid;
    }

    public String createCookieJson(){
        String orgJsonDtr= JSON.toJSONString(this);
        return DES_UTIL.encrypt(orgJsonDtr);
    }

    public static com.dldata.display.businessmodel.SessionUserInfoEntity fromCookieJson(String cookieJson){
        String desCookieJson=DES_UTIL.decrypt(cookieJson);
        com.dldata.display.businessmodel.SessionUserInfoEntity sessionUserInfoEntity= JSON.parseObject(desCookieJson, com.dldata.display.businessmodel.SessionUserInfoEntity.class);
        return sessionUserInfoEntity;
    }
}
